<template>
<div>
  <mt-header title="常见问题" class="header">
     <router-link to="/aboutme" slot="left">
        <mt-button icon="back" class="back"></mt-button>
        <mt-button ></mt-button>
    </router-link>
</mt-header>
   <div class="xq1" v-for="(item,i) of question" :key="i"  @click="open(i)">
       <div class="xq">
        <div class="l">Q</div>
        <span class="l1">{{item.title}}</span>
        <a v-if="show!=i" href="javascript:;"><img src="img/cjwt/xiang.png" alt=""></a>
        <a v-else href="javascript:;"><img src="img/cjwt/shang.png" alt=""></a>
       </div>
        <div class="content" v-show="show==i">
       {{item.content}}
      </div>
   </div>
</div>
</template>
<script>
export default ({
  data() {
    return{
      show:0,
      question:[],
    }
  },
  methods:{
    open(a){
      this.show=this.show==a?-1:a
    }
  },
  mounted(){
    this.axios.get('/question/questionlist').then(res=>{
      console.log(res)
      this.question=res.data.data;
    })
  }
})
</script>

<style scoped>
    *{
      margin: 0 auto;
      padding: 0;
    }
    .header{
      border-bottom: 10px solid #f5f5f5;
      background-color: #fff;
      color: #333;
      font-size: 18PX;
      text-align: center;
      
    }
   .header .back{
      line-height: 40px;
    }
   .xq{
     font-weight: 700; 
     height: 29px;
     border: 0 solid #d6e4ef;
     background-color: #fff;
    }
   .l{
     margin-right:7px ;
    float: left;
    width:22px;
    height:22px;
    background-color: #f74444;
    border-radius: 4px;
    color: #fff;
    text-align: center;
    line-height: 22px;
    font-size: 10px; 
      
   }
  .xq .l1{
    float: left;
    font-size: 15px;
  }
  .xq img{
    width: 15px;
    height: 9px;
    float: right;
    background-color: #fff;
    margin-top:7px ;
  }
  .content{
    padding: 10px 12px;
    font-size: 14px;
    width: 327px;
    line-height: 25px;
    border: 1px solid #d6e4ef;
    background-color: #f5f5f5;
    border-radius:9px ;
    word-break:break-all;
  }
  .xq1{
    padding: 17px 12px 10px 12px;
    border-bottom:5px solid  #f5f5f5;
  }
</style>>

